package com.sys.orders.pojo;


import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.sys.common.pojo.BasePojo;
import com.sys.goods.pojo.ABlindbox;


/**
 * 订单明细表
 * 
 * @author lby
 *
 */
public class AOrdersGoods extends BasePojo<AOrdersGoods>
{
	private int orderDetailsId;
	private int orderId;
	private int blindBoxId;
	private double settlementPrice;
	private int goodsQuantity;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	private String statusStr;
	/* 关联关系 */
	private ABlindbox blindbox ; 
	
	/*
	 * 方便枚举项在网页上显示出来 键为值(数字), 值为字符串描述 只提供get方法
	 */
	private Map<String, String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		AOrdersGoodsEnum[] aordersgoodsenum = AOrdersGoodsEnum.values();
		for (int i = 0; i < aordersgoodsenum.length; i++)
		{
			AOrdersGoodsEnum aordersgoodsEnum = aordersgoodsenum[i];
			String key = aordersgoodsEnum.toString();
			enumsMap.put(key + "-" + aordersgoodsEnum.getStatus() + "", aordersgoodsEnum.getName());
		}
		return enumsMap;
	}

	public String getStatusStr()
	{
		AOrdersGoodsEnum[] values = AOrdersGoodsEnum.values();
		for (int i = 0; i < values.length; i++)
		{
			AOrdersGoodsEnum aordersgoodsEnumTemp = values[i];
			if (aordersgoodsEnumTemp.toString().startsWith("STATUS"))
			{
				if (aordersgoodsEnumTemp.getStatus() == this.status)
				{
					this.statusStr = aordersgoodsEnumTemp.getName();
				}
			}
		}

		return statusStr;
	}

	public int getOrderDetailsId()
	{
		return orderDetailsId;
	}

	public void setOrderDetailsId(int orderDetailsId)
	{
		this.orderDetailsId = orderDetailsId;
	}

	public int getOrderId()
	{
		return orderId;
	}

	public void setOrderId(int orderId)
	{
		this.orderId = orderId;
	}

	public int getBlindBoxId()
	{
		return blindBoxId;
	}

	public void setBlindBoxId(int blindBoxId)
	{
		this.blindBoxId = blindBoxId;
	}

	public double getSettlementPrice()
	{
		return settlementPrice;
	}

	public void setSettlementPrice(double settlementPrice)
	{
		this.settlementPrice = settlementPrice;
	}

	public int getGoodsQuantity()
	{
		return goodsQuantity;
	}

	public void setGoodsQuantity(int goodsQuantity)
	{
		this.goodsQuantity = goodsQuantity;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public ABlindbox getBlindbox() {
		return blindbox;
	}

	public void setBlindbox(ABlindbox blindbox) {
		this.blindbox = blindbox;
	}

}
